import React, { Component } from 'react'
import { Carousel } from 'antd-mobile';
import '../style/less/home/HoneBrren/HoneBrren.less'
import banren1 from '../style/images/banner1.png'
import banren2 from '../style/images/banner2.png'
import banren3 from '../style/images/banner3.png'
export default class honeBrren extends Component {
    state = {
        data: [banren1,banren2,banren3],
        imgHeight: 176,
      }
    render() {
        return (
            <div>
                <Carousel
                    autoplay={true}
                    infinite
                >
                    {this.state.data.map((val,i) => (
                        <a
                            key={i}
                            href="http://www.baidu.com"
                            style={{ display: 'inline-block', width: '100%', height: this.state.imgHeight }}
                        >
                            <img
                                src={val}
                                alt=""
                                style={{ width: '100%', verticalAlign: 'top' }}
                                onLoad={() => {
                                    window.dispatchEvent(new Event('resize'));
                                    this.setState({ imgHeight: 'auto' });
                                }}
                            />
                        </a>
                    ))}
                </Carousel>
            </div>
        )
    }
}
